package com.dlc.shop.systemtest.data.amount;

import com.dlc.shop.user.common.model.UserLevel;
import com.dlc.shop.user.common.model.UserLevelLang;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author lanhai
 */
public class UserLevelData {


    public static UserLevel getUserLevel(Long id, Integer level, Integer needGrowth, Double discount, Integer levelType){
        UserLevel userLevel = new UserLevel();
        userLevel.setCategorys(null);
        userLevel.setCouponList(null);
        userLevel.setDiscount(discount);
        userLevel.setDiscountRange(0);
        userLevel.setDiscountType(0);
        userLevel.setId(id);
        userLevel.setIsFreeFee(0);
        userLevel.setLevel(level);
        userLevel.setLevelName("会员等级测试1" + level + id);
        userLevel.setLevelType(Objects.isNull(levelType) ? 0 :levelType);
        userLevel.setNeedAmount(null);
        userLevel.setNeedGrowth(needGrowth);
        userLevel.setPresScore(1L);
        userLevel.setRateScore(1D);
        userLevel.setStatus(1);
        userLevel.setTerm(1);
        userLevel.setTermType(3);
        userLevel.setUserRights(null);
        userLevel.setImg("/test.png");
        userLevel.setLevelNameCn(userLevel.getLevelName());
        UserLevelLang userLevelLangCn = new UserLevelLang();
        userLevelLangCn.setLevelName(userLevel.getLevelName());
        userLevelLangCn.setLang(0);
        UserLevelLang userLevelLangEn = new UserLevelLang();
        userLevelLangEn.setLang(1);
        userLevel.setUserLevelLangList(Arrays.asList(userLevelLangCn,userLevelLangEn));
        return userLevel;
    }


    //只用于改变折扣

}
